export const hasPermission = (permission: string | string[]) => {
  const authStore = useAuthStore()
  const permissions = authStore.permissions
  
  if (typeof permission === 'string') {
    return permissions.includes(permission)
  }
  
  return permission.some(p => permissions.includes(p))
}

export const checkPermission = (el: HTMLElement, permission: string) => {
  if (!hasPermission(permission)) {
    el.parentNode?.removeChild(el)
  }
} 